# FROM 10.48.0.86:5001/dut-water/conda-xarray-data-base
FROM 172.20.7.86:5001/dut-water/conda-xarray-torch

LABEL maintainer="Gaoyu <gaoyu.ssdut@icloud.com>"

# 设置环境变量
ENV PATH /root/miniconda3/bin:/root/miniconda3/condabin:$PATH
RUN echo $PATH
# RUN sed -i 's@http://archive.ubuntu.com/@http://mirrors.tuna.tsinghua.edu.cn/@g' /etc/apt/sources.list \
#     && sed -i 's@http://security.ubuntu.com/@http://mirrors.tuna.tsinghua.edu.cn/@g' /etc/apt/sources.list \
#     && sed -i 's#http://ports.ubuntu.com/ubuntu-ports/#http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/#g' /etc/apt/sources.list
# RUN sed -i 's@http://archive.ubuntu.com/@http://mirror.dlut.edu.cn/@g' /etc/apt/sources.list \
#     && sed -i 's@http://security.ubuntu.com/@http://mirror.dlut.edu.cn/@g' /etc/apt/sources.list
RUN apt-get update
RUN apt-get install git -y
RUN apt-get install vim -y
# # 安装s3fs
# RUN apt-get install fuse -y
# RUN apt-get install s3fs -y
# # 挂载s3
# RUN echo "k0Rgmb6IbwlFnoyvhqnm:89xozgjydEWBURfcHJW9TwT0kGZZNK4a1mjWRz72" > ~/.passwd-s3fs
# RUN chmod 600 ~/.passwd-s3fs
# RUN mkdir -p ~/minio/grids-origin
# RUN s3fs grids-origin ~/minio/grids-origin -o use_path_request_style  -o passwd_file=~/.passwd-s3fs -o url=http://172.20.7.86:9000
# RUN mkdir -p ~/minio/gfs-origin
# RUN s3fs gfs-origin ~/minio/gfs-origin -o use_path_request_style  -o passwd_file=~/.passwd-s3fs -o url=http://172.20.7.86:9000

# 更新pip
RUN pip install --upgrade pip --trusted-host 172.20.7.86 --index-url http://172.20.7.86:8931/repository/pypi-public/simple

# 工作目录
WORKDIR /app
COPY . /app


# docker时区问题
# RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# pip安装依赖包
COPY requirements.txt /tmp/requirements.txt
RUN ["pip", "install","--default-timeout=200", "-r", "/tmp/requirements.txt","--index-url","https://pypi.tuna.tsinghua.edu.cn/simple"]
# RUN pip install -r requirements_docker.txt --index-url https://pypi.tuna.tsinghua.edu.cn/simple

# EXPOSE 8000

# CMD ["uvicorn", "api_service:app", "--host", "0.0.0.0", "--port", "8001", "--reload"]
# CMD ["nohup", "python", "xaj_service.py", "&"]
CMD ["tail", "-f", "/dev/null"]


# git
# git clone https://gaoyussdut:zdKYXrg-LNNJumtS6N7_VLXZ@gitcode.com/dlut-water/raindall_gfs_revise.git

# image
# docker build -f Dockerfile -t rainfall_gfs_revise:new .
# container
# docker run --name rainfall_gfs_revise_stable -d --network=host -p 8001:8001 -v ~/minio:/app/minio:rw rainfall_gfs_revise:new

# update
# docker exec -ti rainfall_gfs_revise_stable bash
# git pull
# 如果更新不下来
# git config --global user.name gaoyussdut
# git config --global user.email gaoyu.ssdut@icloud.com